/*
 * Divide_3_5
 *
 * Version 1.2
 *
 * @since   26/09/2009
 * @updated 30/09/2009
 * @author  Olga Titova, mozaec@gmail.com
 */

package divide_3_5;

import java.util.Scanner;

/** Main class*/
public class Divide_3_5
{
    /** Variable, whitch contents the number of "3" */
    static int quantityOf3;

     /** Variable, whitch contents the number of "5" */
    static int quantityOf5;

     /** Method, that divides n to 3 and 5*/
    public static void Divide(int n)
    {
        /** checking if n multiple of 3*/
        if (n%3 == 0){
            quantityOf3 = n/3;
            quantityOf5 = 0;
        }
        else{
            /** checking if n multiple of 5*/
            if (n%5 == 0){
                quantityOf3 = 0;
                quantityOf5 = n/5;
            }
            else{
                /** remainder of n/3 = 1*/
                if (n%3 == 1){
                    quantityOf3 = n/3-3;
                    quantityOf5 = 2;
                }
                /** remainder of n/3 = 2*/
                else{
                    quantityOf3 = n/3-1;
                    quantityOf5 = 1;
                }
            }
        }
    }

    /** Main method*/
    public static void main(String[] args)
    {
       System.out.println("Input n>7 :"); //Input variable n
       Scanner in = new Scanner (System.in);
       int n = in.nextInt ();
       in.close ();
       Divide (n); // Calling metod Divide
       System.out.println (n+"=3*"+quantityOf3+"+5*"+quantityOf5); //Output solution
    }
  
} //End of the program
